<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Manager extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		$this->config->load('my_options', TRUE);
		$this->load->model('R_Table_Pdf_Model','',TRUE);
	}

	public function index()
	{
		redirect('manager/table_pdf_index');
	}
	
	public function table_pdf_index(){
	
		$lists = $this->R_Table_Pdf_Model->get_all();
		$data = array(
			'base_category' => $this->config->item('base_category', 'my_options'),
			'lists' => $lists,

		);
		//print_r($data);
		$this->load->view('manager_table_pdf_index', $data);
	}
	
	public function table_pdf_create(){
		$data = $this->input->post();
		$customer = $this->R_Table_Pdf_Model->insert_entry($data);
		redirect('manager/table_pdf_index');
	}
	
	public function table_pdf_detail($id){
		if( empty($id) ){
			show_error('参数错误，无法处理' );
		}
		$doc = $this->R_Table_Pdf_Model->get_one($id);
		$data = array(
			'doc'=>$doc,
			'base_category' => $this->config->item('base_category', 'my_options'),
		);
		$this->load->view('manager_table_pdf_detail', $data);
	}
	
	public function table_pdf_update(){
		$id = $this->input->post('id');
		
		if ( empty($id) ){
			show_error('参数错误，请检查后提交' );
		}
		
		$this->R_Table_Pdf_Model->update_entry($id, $this->input->post());
		echo ('资料更新成功' );
	}

}

/* End of file manager.php */
/* Location: ./application/controllers/manager.php */